package com.cfm880.latte.core.app;

import android.content.Context;

import java.util.HashMap;

/**
 * Created by chengfangming on 2018/1/5.
 */

public final class Latte {
    public static Configurator init(Context context){
        getConfigurations().put(ConfigKeys.APPLICATION_CONTEXT.name(), context.getApplicationContext());
        return Configurator.getInstance();
    }


    public static HashMap<Object, Object> getConfigurations(){
        return Configurator.getInstance().getLatteConfigs();
    }

    public static <T> T getConfiguration(Enum<ConfigKeys> object){
        return Configurator.getInstance().getConfiguration(object);
    }

    public static Context getApplicationContext(){
        return (Context) Configurator.getInstance().getLatteConfigs().get(ConfigKeys.APPLICATION_CONTEXT.name());
    }

}
